package db.dto;

import java.io.Serializable;

public class DepartmentDto implements Serializable, AbstractDto
{
	/** 
	 * This attribute maps to the column ID_DEPARTMENT in the DEPARTMENT table.
	 */
	protected int idDepartment;

	/** 
	 * This attribute maps to the column NAME in the DEPARTMENT table.
	 */
	protected String name;

	/**
	 * Method 'DepartmentDto'
	 * 
	 */
	public DepartmentDto()
	{
	}

	/**
	 * Method 'getIdDepartment'
	 * 
	 * @return int
	 */
	public int getIdDepartment()
	{
		return idDepartment;
	}

	/**
	 * Method 'setIdDepartment'
	 * 
	 * @param idDepartment
	 */
	public void setIdDepartment(int idDepartment)
	{
		this.idDepartment = idDepartment;
	}

	/**
	 * Method 'getName'
	 * 
	 * @return String
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * Method 'setName'
	 * 
	 * @param name
	 */
	public void setName(String name)
	{
		this.name = name;
	}

    public int getId() {
        return this.idDepartment;
    }

    /**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */

	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof DepartmentDto)) {
			return false;
		}
		
		final DepartmentDto _cast = (DepartmentDto) _other;
		if (idDepartment != _cast.idDepartment) {
			return false;
		}
		
		if (name == null ? _cast.name != name : !name.equals( _cast.name )) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + idDepartment;
		if (name != null) {
			_hashCode = 29 * _hashCode + name.hashCode();
		}
		
		return _hashCode;
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "db.dto.DepartmentDto: " );
		ret.append( "idDepartment=" + idDepartment );
		ret.append( ", name=" + name );
		return ret.toString();
	}

}
